package sz.com.postoffice.jxyzwgcase.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import sz.com.postoffice.jxyzwgcase.core.TableDataInfo;
import sz.com.postoffice.jxyzwgcase.pojo.TGrid;
import sz.com.postoffice.jxyzwgcase.service.OrgService;

/**
 * @ClassName OrgController
 * @Deacription TODO
 * @Author liuyi
 * @Date 2020/10/23 13:58
 * @Version 1.0
 **/
@Api(value = "机构相关", tags = "{ 机构相关API }")
@RestController
@RequestMapping(value = "/org")
public class OrgController {

    @Resource
    private OrgService orgService;

    @ApiOperation(value = "获取ADO当前用户的组织数据", notes = "获取ADO当前用户的组织数据")
    @RequestMapping(value = "/getOrgList", method = RequestMethod.GET)
    @ResponseBody
    public TableDataInfo getOrgList(TGrid tGrid) {
    	TableDataInfo tableDataInfo = orgService.getOrgList(tGrid);
        return tableDataInfo;
    }
    
    @ApiOperation(value = "获取段道树", notes = "获取段道树")
    @RequestMapping(value = "/getTGridList", method = RequestMethod.GET)
    @ResponseBody
    public TableDataInfo getTGridList(TGrid tGrid) {
    	TableDataInfo tableDataInfo = orgService.getTGridList(tGrid);
        return tableDataInfo;
    }
}
